Conventionally, an information processing program for placing an object in a virtual space, based on an instruction of a user, has been known. For example, a game program has been known which allows a user, through his/her instruction, to place an object such as a block in a game space, and allows a player to play a game on the game space in which the object is placed.
When an object having an acute angle part is placed in a virtual space, the acute angle part may hinder a process of detecting a collision between this object and another object, or may complicate the process of collision detection.
Therefore, the present application discloses a storage medium having stored therein an information processing program, an information processing apparatus, an information processing system, and an information processing method, which allow the process of collision detection to be easily performed.
(1) An example of a non-transitory computer readable storage medium described in this specification has stores therein an information processing program to be executed by a computer processor, of an information processing apparatus, for placing a component object to be used for collision detection in a virtual space, based on an instruction of a user. The information processing program causes the computer processor to function as object placement means and image generation means. The object placement means places a slope object having a unit portion, as the component object in the virtual space, based on the instruction of the user. The image generation means generates an image representing the virtual space in which the component object is placed. The object placement means places a first slope object having one unit portion, as the slope object in the virtual space, based on a first instruction of the user. The unit portion has a first portion and a second portion. The first portion has a first side and a second side that form an interior angle being an acute angle. The second portion has a continuous side that is continuous to a vertex of the angle formed by the first side and the second side, and has a side including at least a part of the second side. An interior angle formed by the continuous side and the first side is 90° or more. The object placement means places a second slope object as the slope object in the virtual space, based on a second instruction of the user. The second slope object has a continuous unit portion in which a plurality of the unit portions are connected such that a plurality of the first sides thereof are connected to form a single side.
According to the configuration of the above (1), since the unit portion has the second portion in addition to the first portion having an acute angle part. The second portion allows the acute angle part of the first portion to have an angle of 90° or more. Thus, the number of acute angles in the slope object can be reduced, or the position of an acute angle in the slope object can be changed. Therefore, the likelihood of occurrence of a problem caused by presence of an acute angle in the virtual space can be reduced, whereby the information processing apparatus can easily perform the process of collision detection.
(2) The first portion of the unit portion may have a third side, and an interior angle formed by the first side and the third side may be an acute angle. The slope object further includes a first continuous portion. The first continuous portion has a continuous side that is continuous to an end of a side including the first side of the slope object, and that is continuous to the third side of the unit portion. The first continuous portion has a side including at least a part of the third side. An interior angle formed by the continuous side and the side including the first side is 90° or more.
According to the configuration of the above (2), the acute angle formed by the first side and the third side of the slope object can be eliminated. By placing such a slope object, the likelihood of generation of an acute angle in the virtual space can be reduced.
(3) The continuous side that is continuous to the first side and to the third side may be perpendicular to the gravity direction of the virtual space.
According to the configuration of the above (3), a slope object, in which a side perpendicular to the gravity direction (in other words, a side in the horizontal direction in the virtual space) is continuous to the first side that is oblique to the gravity direction, can be placed. Since such a slope object is easy to use for the user, convenience of the user can be improved.
(4) The slope object may further include a second continuous portion having a continuous side that is continuous to an end of a side including the first side of the slope object, is continuous to the second side of the unit portion, and is perpendicular to the gravity direction of the virtual space.
According to the configuration of the above (4), as in the configuration of the above (3), a slope object, in which a side in the horizontal direction in the virtual space is continuous to the first side that is oblique to the gravity direction, can be placed. Thus, convenience of the user can be improved.
(5) The information processing program may cause the computer processor to function as deletion means. In a case where the slope object is placed in the virtual space such that an end of a side including the first side of the slope object is continuous to a side of another component object, if a part of the slope object overlaps a part of the another component object, the deletion means executes a deletion process of deleting the part of the slope object or the part of the another component object.
According to the configuration of the above (5), the deletion process allows the other component object to be placed such that the oblique side of the slope object is continuous to the other component object. Thus, it is possible to increase the degree of freedom in the shapes that can be generated by component objects.
(6) The deletion means, in the deletion process, may delete the first continuous portion or the second continuous portion, of the slope object, which overlaps the another component object.
According to the configuration of the above (6), by deleting the continuous portion, the shape of the slope object can be altered such that the oblique side of the slope object can be continuous to another component object.
(7) The information processing program may cause the computer processor to function as restoration means. In a case where the component object, which has been partially deleted through the deletion process, is moved based on an instruction of the user and consequently the overlapping with the another component object is eliminated, the restoration means restores the component object, which has been partially deleted, to the state before deletion in the deletion process.
According to the configuration of the above (7), when overlapping of the slope object is eliminated after the deletion process has been executed, the component object, which has been partially deleted, can be restored to the original shape.
(8) The object placement means may change the number of the unit portions included in the slope object placed in the virtual space, based on an instruction of the user.
According to the configuration of the above (8), the object placement means can easily change the length of the oblique side of the slope object.
(9) The unit portion may be a parallelogram having the first side and the second side.
According to the configuration of the above (9), since the unit portion and the continuous unit portion each are a parallelogram, the object placement means can place a slope object having two oblique sides.
(10) The object placement means may place the component object such that vertices of the component object are positioned at intersections of a grid set in the virtual space.
According to the configuration of the above (10), since the component object is placed along the grid, the user can easily place objects, thereby improving convenience in placing component objects.
(11) The information processing program may cause the computer processor to function as complementing means. When a predetermined type of component object is placed in the virtual space, the complementing means determines whether or not a slope object is placed in a part of a determination target cell that is located within a predetermined distance from a cell of the grid where the predetermined type of component object is placed. When a slope object is placed in a part of the determination target cell, the complementing means places a complementary object as a component object so as to fill the entirety of the determination target cell.
According to the configuration of the above (11), a complementary object is placed near a slope object, according to need. Thus, it is possible to reduce the likelihood of generation of a region, from which a player object having entered the region cannot easily escape (a small cell region in an exemplary embodiment described below), near the slope object.
(12) The grid may be composed of a plurality of square cells. The object placement means may invert or rotate the component object within the virtual space, based on an instruction of the user.
According to the configuration of the above (12), the degree of freedom in placing slope objects can be increased.
(13) The object placement means may place the slope object such that the first side of the unit portion is placed along a diagonal line of a quadrangle composed of one or more cells of the grid, and the second side is placed along a side of the cell.
(14) A positive integer, which divides both the number of cells in the vertical direction in the quadrangle whose diagonal line corresponds to the first side of the unit portion and the number of cells in the horizontal direction in the quadrangle, may be only 1.
According to the configuration of the above (14), in the case where the component object is placed in units of cells of the grid, the object placement means can change the length of the oblique side of the slope object in the minimum units. Thus, the degree of freedom in placing slope objects can be increased, and the game space can be effectively utilized.
(15) The information processing program may cause the computer processor to function as player object control means. The player object control means causes a player object placed in the virtual space to move in the virtual space in which the component object is placed, based on an instruction of a player.
According to the configuration of the above (15), in the process of causing the player object to move in the virtual space in which the component object is placed, based on the instruction of the user, it is possible to easily perform a process of detecting a collision between the player object and the component object.
(16) The object placement means may place, as the component object, a two-dimensional object or a three-dimensional object in the virtual space.
This specification discloses examples of an information processing apparatus and an information processing system including the respective means described in the above (1) to (16). In addition, this specification discloses an example of an information processing method to be executed in the information processing apparatus (or the information processing system) in the above (1) to (16).
According to the storage medium having stored therein the information processing program, the information processing apparatus, the information processing system, and the information processing method, the process of collision detection can be easily performed.
These and other objects, features, aspects and advantages of the exemplary embodiment will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.